
#ifndef _MEMBER_BMAINWINDOW_H_
#define _MEMBER_BMAINWINDOW_H_

#include <BTexture>
#include <BFont>
#include <BImage>
#include <BDialog>
#include <BImage>
#include <BIcon>
#include <BButton>
#include <BPixmap>
#include <BScreen>
#include <BHBoxLayout>
#include <BMainWindow>
#include "IAlignment.h"

namespace BWE
{
	class member_BMainWindow : public BObject
	{
		friend class BMainWindow;
	public:
		static const char* ButtonName(Button button);
		static Graph ButtonGraph(Button button);

	public:
		member_BMainWindow(BMainWindow* mainWindow);
		~member_BMainWindow();

		bool resizable();
		void adaptSize();
		void centerAlign();
		void freshRects();

		void slotParentChanged(BObject* object, const BValue& value);
		void slotParentResized(BObject* object, const BValue& value);
		void slotButtonClicked(BButton* button, const BValue& value);

	public:
		BMainWindow*		boss;
		BWidget*			parent;
		bool				titleVisible;
		int					titleHeight;
		BSize				titleIconSize;
		BMargin				titleMargin;
		const BStyle*		titleStyle;
		bool				autoTop;
		bool				centering;
		bool				adapting;
		Align				buttonAlign;
		BHBoxLayoutHolder	buttonLayout;

		bool			dirty;
		BRect			titleRect;
		IAlignment		alignment;
		bool			hoverTitle;
		bool			pressed;
		BPoint			pressedPos;
		BRect			pressedRect;
		BRect			normalRect;
		BMargin			normalMargin;
		ShowState		showState;

		Part			resizePart;
		BRect			borderTop;
		BRect			borderLeft;
		BRect			borderRight;
		BRect			borderBottom;
		BRect			cornerLeftTop;
		BRect			cornerRightTop;
		BRect			cornerLeftBottom;
		BRect			cornerRightBottom;

	};
}

#endif
